<?php

namespace test;

use core\test\PHPUnitTest;

/**
 * 对Router进行测试
 * Class TestRouter
 * @package test\modules
 */
class TestRouter extends PHPUnitTest {
    public function testRouterMethod() {
        $res = $this->get('http://localhost/index/postTest', [], [], [CURLOPT_HEADER=>true]);
        $this->assertTrue(strpos(explode("\n", $res)[0], '405') !== false);
    }

    public function testRouterAlias() {
        $res = $this->get('http://localhost/ap/test1');
        $this->assertEquals($res, 'test1');

        $res = $this->get('http://localhost/ap/test');
        $this->assertEquals($res, 'test1');
    }
}